package com.tan.collection.algorithm;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class AlgorithmTest {
    public static void main(String[] args) {
        List<Integer> numbers = new ArrayList<>();
        for (int i =1;i<=49;i++) {
            numbers.add(i);
        }
        //混排，把顺序打乱
        Collections.shuffle(numbers);
        //获取前六个整数
        List<Integer> winningCombination = numbers.subList(0,6);
        //排序
        Collections.sort(winningCombination);
        System.out.println(winningCombination);
    }
}
